qinv($r$) $\,\equiv$$_{\mbox{\scriptsize def}}$$\;\;$if isint($r$;tt;ff) then $<$1, $r$$>$ else let $p$,$q$ = $r$ in $<$$q$, $p$$>$ fi